<?php

class DefaultController extends Controller
{
	
	/**
	 * Lists all models.
	 */
	public function actionIndex()
	{ //exit("here ind");
		//exit("here");
		//if(Yii::app()->user->isGuest)
	 	//$this->redirect(ApplicationConfig::getURL('', 'admin', 'login'));
		if( ApplicationSessions::run()->read('admin_email') && ApplicationSessions::run()->read('admin_id') && ApplicationSessions::run()->read('admin_username') )
		{
		$this->redirect(ApplicationConfig::getURL('', 'admin', 'profile'));
		}
		else {
			$this->redirect(ApplicationConfig::getURL('', 'admin', 'login'));
		}
		
		$dataProvider=new CActiveDataProvider('User', array(
			'criteria'=>array(
		        'condition'=>'status>'.User::STATUS_BANED,
		    ),
			'pagination'=>array(
				//'pageSize'=>Yii::app()->controller->module->user_page_size,
			),
		));

		$this->render('index',array(
			'dataProvider'=>$dataProvider,
		));
		
	}

}